import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/user/:id/base_information',
    name: 'BaseInformation',
    component: () => import('../views/BaseInformation.vue')
  },
  {
    path: '/user/:id/username',
    name: 'Username',
    component: () => import('../views/Username.vue')
  },
  {
    path: '/user/:id/password/change',
    name: 'PasswordChange',
    component: () => import('../views/PasswordChange.vue')
  },
  {
    path: '/user/:id/email',
    name: 'Email',
    component: () => import('../views/Email.vue')
  },
  {
    path: '/post',
    name: 'PostList',
    component: () => import('../views/PostList.vue')
  },
  {
    path: '/post/:id',
    name: 'PostDetail',
    component: () => import('../views/PostDetail.vue')
  },
  {
    path: '/:id/post',
    name: 'PostManage',
    component: () => import('../views/PostManage.vue')
  },
  {
    path: '/:id/post/add',
    name: 'PostAdd',
    component: () => import('../views/PostAdd.vue')
  },
  {
    path: '/:id/post/edit',
    name: 'PostEdit',
    component: () => import('../views/PostEdit.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
